package com.chcit.handmedicine.base;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

public class ThreadPool {
	private static ThreadPool _instance;
	private ExecutorService pool;

	private ThreadPool() {
		pool = Executors.newCachedThreadPool();
	}

	public static ThreadPool getInstance() {
		if (_instance == null)
			_instance = new ThreadPool();
		return _instance;
	}

	public void runInThreadPool(Runnable command) {
		pool.execute(command);
	}
}
